import { ReactElement, useCallback } from "react";
import { Input } from "../BUI";

const Price = ({
  changePrice,
}: {
  changePrice: (price: string) => void;
}): ReactElement => {
  const handleChangePrice = useCallback(
    ({ detail: { value } }) => {
      changePrice(value);
    },
    [changePrice]
  );

  return <Input onInput={handleChangePrice} label='价格' type='number' />;
};

export default Price;
